import axios from '../utils/http'
// 添加新库存
export function stockCreate (payload) {
  return axios({
    url: '/stock/create',
    method: 'post',
    data: payload
  })
}
// 出库工单
export function outStockGet (params) {
  return axios({
    url: '/outStock/get',
    method: 'get',
    params: params
  })
}
export function outStockCreate (payload) {
  return axios({
    url: '/outStock/create',
    method: 'post',
    data: payload
  })
}
export function outStockUpdate (payload) {
  return axios({
    url: '/outStock/update',
    method: 'put',
    data: payload
  })
}
export function outStockDelete (_id) {
  return axios({
    url: '/outStock/delete?_id=' + _id,
    method: 'delete'
  })
}
// 入库工单
export function inStockGet (params) {
  return axios({
    url: '/inStock/get',
    method: 'get',
    params: params
  })
}
export function inStockCreate (payload) {
  return axios({
    url: 'inStock/create',
    method: 'post',
    data: payload
  })
}
export function inStockUpdate (payload) {
  return axios({
    url: '/inStock/update',
    method: 'put',
    data: payload
  })
}
export function inStockDelete (_id) {
  return axios({
    url: '/inStock/delete?_id=' + _id,
    method: 'delete'
  })
}
// 设备类型
export function stockDeviceTypeGet (params) {
  return axios({
    url: '/stockDeviceType/get',
    method: 'get',
    params: params
  })
}
export function stockDeviceTypeCreate (payload) {
  return axios({
    url: 'stockDeviceType/create',
    method: 'post',
    data: payload
  })
}
export function stockDeviceTypeUpdate (payload) {
  return axios({
    url: '/stockDeviceType/update',
    method: 'put',
    data: payload
  })
}
export function stockDeviceTypeDelete (_id) {
  return axios({
    url: '/stockDeviceType/delete?_id=' + _id,
    method: 'delete'
  })
}
// 规格型号
export function specificationGet (params) {
  return axios({
    url: '/specification/get',
    method: 'get',
    params: params
  })
}
export function specificationCreate (payload) {
  return axios({
    url: '/specification/create',
    method: 'post',
    data: payload
  })
}
export function specificationUpdate (payload) {
  return axios({
    url: '/specification/update',
    method: 'put',
    data: payload
  })
}
export function specificationDelete (_id) {
  return axios({
    url: '/specification/delete?_id=' + _id,
    method: 'delete'
  })
}
// 供应商
export function supplierGet (params) {
  return axios({
    url: '/supplier/get',
    method: 'get',
    params: params
  })
}
export function supplierCreate (payload) {
  return axios({
    url: 'supplier/create',
    method: 'post',
    data: payload
  })
}
export function supplierUpdate (payload) {
  return axios({
    url: '/supplier/update',
    method: 'put',
    data: payload
  })
}
export function supplierDelete (_id) {
  return axios({
    url: '/supplier/delete?_id=' + _id,
    method: 'delete'
  })
}
// 库存综合查询
export function stockGetConditions (params) {
  return axios({
    url: '/stock/getConditions',
    method: 'get',
    params: params
  })
}
export function stockGet (params) {
  return axios({
    url: '/stock/get',
    method: 'get',
    params: params
  })
}
export function stockGetInOut (params) {
  return axios({
    url: 'stock/getInOut',
    method: 'get',
    params: params
  })
}
